<?php
/***********************************************
	This class would retrieve data from an
	array.
************************************************/
class ArrayDataRetriever {
	private $title = NULL;
	private $link = NULL;
	private $snippet = NULL;
	
	private $phpArrayValuesToInsert = NULL;
	private $phpArray = NULL;
	
	/************************************************************/
	
	function __construct() {
		$this->phpArray = array();
	}
	
	/************************************************************/
	
	function retrieveArrayData($decodedJSONData) {
		foreach ($decodedJSONData['items'] as $key) {
			if (is_array($key)) {
				$this->title = $key['title'];
				$this->link = $key['link'];
				$this->snippet = $key['snippet'];
						
				$this->phpArrayValuesToInsert = array(
					"Title" => $this->title,
					"Link" => $this->link,
					"Snippet" => $this->snippet
				);
				
				array_push($this->phpArray, $this->phpArrayValuesToInsert);
			}
		}
		
		return $this->phpArray;
	}
}
?>